<?php
function deletePar($inEvent,$sn,$type = false){
    settype($inEvent,"integer");
    settype($sn,"integer");
    
    if($type){
    	$sql = sprintf("DELETE FROM event_%s_waitlist WHERE SN = %s;", $inEvent,$sn);
    }else{
    	$sql = sprintf("DELETE FROM event_%s WHERE SN = %s;", $inEvent,$sn);
    }
    
    $res = sendQ($sql);
    
    if($res){
        return true;
    }
    
    return false;

}

function deleteEvent($id){
	settype($id,"integer");
	$sql = sprintf("DROP TABLE %s;",'event_' . $id);
	sendQ($sql);
	$sql = sprintf("DROP TABLE %s;",'event_' . $id . '_waitlist');
	sendQ($sql);
	$sql = sprintf("DELETE FROM events WHERE events.ID = %s;",$id);
	sendQ($sql);
}

function deletePendingMember($sn){
	settype($sn,"integer");
	$sql = sprintf("DELETE FROM pendingmembers WHERE SN = %s;",$sn);
	$res = sendQ($sql);
	
	if($res){
		return 1;
	}
	
	return 0;
}
?>
